﻿
#ifndef	__EFFEKSEER_TRACK_RENDERER_H__
#define	__EFFEKSEER_TRACK_RENDERER_H__

//----------------------------------------------------------------------------------
// Include
//----------------------------------------------------------------------------------
#include "../Effekseer.Base.h"
#include "../Effekseer.Vector2D.h"
#include "../Effekseer.Vector3D.h"
#include "../Effekseer.Matrix43.h"
#include "../SIMD/Effekseer.Vec2f.h"
#include "../SIMD/Effekseer.Vec3f.h"
#include "../SIMD/Effekseer.Mat43f.h"
#include "../Effekseer.Color.h"

//----------------------------------------------------------------------------------
//
//----------------------------------------------------------------------------------
namespace Effekseer
{

struct NodeRendererTextureUVTypeParameter;

	//----------------------------------------------------------------------------------
	//
	//----------------------------------------------------------------------------------

	class TrackRenderer
	{
	public:

		struct NodeParameter
		{
			Effect*				EffectPointer;
			//int32_t				ColorTextureIndex;
			//AlphaBlendType			AlphaBlend;
			//TextureFilterType	TextureFilter;
			//TextureWrapType		TextureWrap;
			bool				ZTest;
			bool				ZWrite;

			//bool				Distortion;
			//float				DistortionIntensity;

			int32_t				SplineDivision;

			bool IsRightHand;
			NodeRendererDepthParameter* DepthParameterPtr = nullptr;
			NodeRendererBasicParameter* BasicParameterPtr = nullptr;
			NodeRendererTextureUVTypeParameter* TextureUVTypeParameterPtr = nullptr;

			RendererMaterialType MaterialType = RendererMaterialType::Default;
			MaterialParameter* MaterialParameterPtr = nullptr;
		};

		struct InstanceGroupParameter
		{

		};

		struct InstanceParameter
		{
			int32_t			InstanceCount;
			int32_t			InstanceIndex;
			Mat43f			SRTMatrix43;

			Color	ColorLeft;
			Color	ColorCenter;
			Color	ColorRight;

			Color	ColorLeftMiddle;
			Color	ColorCenterMiddle;
			Color	ColorRightMiddle;

			float	SizeFor;
			float	SizeMiddle;
			float	SizeBack;

			RectF	UV;
#ifdef __EFFEKSEER_BUILD_VERSION16__
			RectF	AlphaUV;

			float	FlipbookIndexAndNextRate;

			float	AlphaThreshold;
#endif
			std::array<float, 4> CustomData1;
			std::array<float, 4> CustomData2;
		};

	public:
		TrackRenderer() {}

		virtual ~TrackRenderer() {}

		virtual void BeginRendering(const NodeParameter& parameter, int32_t count, void* userData) {}

		virtual void Rendering(const NodeParameter& parameter, const InstanceParameter& instanceParameter, void* userData) {}

		virtual void EndRendering(const NodeParameter& parameter, void* userData) {}

		virtual void BeginRenderingGroup(const NodeParameter& parameter, int32_t count, void* userData) {}

		virtual void EndRenderingGroup(const NodeParameter& parameter, int32_t count, void* userData) {}
	};

	//----------------------------------------------------------------------------------
	//
	//----------------------------------------------------------------------------------
}
//----------------------------------------------------------------------------------
//
//----------------------------------------------------------------------------------
#endif	// __EFFEKSEER_TRACK_RENDERER_H__